package com.teacher.pojo.enums.items;


public enum CertificateType {
    /**
     * 10->英语等级证书
     * 20->普通话证书
     * 30->计算机证书
     * 40->教师资格证书
     */
    ENGLISH(10, "英语等级证书"),
    SPEAKING(20, "普通话证书"),
    COMPUTER(30, "计算机证书"),
    TEACHER(40, "教师资格证书");
    private Integer code;
    private String name;

    CertificateType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 通过code拿到名称
     *
     * @param type
     * @return
     */
    public static String getNameByCode(Integer type) {
        for (CertificateType eType : CertificateType.values()) {
            if (eType.code.equals(type)) {
                return eType.name;
            }
        }
        return "0";
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
